package memento.theory;

/**
 * 角色类
 */
public class Originator {
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    /**
     * 保存状态对象
     *
     * @return
     */
    public Memento saveState() {
        return new Memento(this.state);
    }

    public void getStateFromMento(Memento memento) {
        this.state = memento.getState();
    }
}
